package cate.common.table.d;

import cate.common.table.common.ParamSheet;
import easy.java.dev.note.NoteField;

public class GDForbidden {

    // TODO: 2022/3/17 策划配置
    @NoteField(value = "每个副本最大关数 ")
    public static final int MAX_FLOOR = 12;

    @NoteField(value = "未配置的值")
    public static final int UNDEFINE_VALUE = -1;

    @NoteField(value = "总榜id")
    public static final Integer RANK_ALL_TYPE = 0;

    @NoteField(value = "副本等级要求")
    public static int EASY_FIGHT_LEVEL_REQUIRE;

    
    public static enum Type{

        /** 总榜 */
        TOTAL(0, GDFunc.FORBIDDEN_ZONE, "总榜"),
        /** 水 */
        FIRE(1, GDFunc.FORBIDDEN_C1, "水"),
        /** 火 */
        WATER(2, GDFunc.FORBIDDEN_C2, "火"),
        /** 木 */
        WOOD(3, GDFunc.FORBIDDEN_C3, "木"),
        /** 土 */
        EARTH(4, GDFunc.FORBIDDEN_C4, "土"),
        /** 光 */
        BRIGHT(5,GDFunc.FORBIDDEN_C5, "光"),
        /** 暗 */
        DARK(6,GDFunc.FORBIDDEN_C6, "暗");

        private int type;
        private int funcId;
        private String name;

        Type(int type, int funcId, String name){
            this.type = type;
            this.funcId = funcId;
            this.name = name;
        }
        public int getType(){
            return this.type;
        }

        public int getFuncId(){
            return this.funcId;
        }

        public String getName(){
            return this.name;
        }

        public static String getName(int type){
            GDForbidden.Type t = get(type);
            if(t != null){
                return t.getName();
            }
            return "";
        }

        public static GDForbidden.Type get(int type){
            for(GDForbidden.Type t : values()){
                if(t.getType() == type){
                    return t;
                }
            }
            return null;
        }

        public static int toFuncId(int roomId) {
            switch (roomId) {
                case GDCamp.Type.C1:
                    return GDFunc.FORBIDDEN_C1;
                case GDCamp.Type.C2:
                    return GDFunc.FORBIDDEN_C2;
                case GDCamp.Type.C3:
                    return GDFunc.FORBIDDEN_C3;
                case GDCamp.Type.C4:
                    return GDFunc.FORBIDDEN_C4;
                case GDCamp.Type.C5:
                    return GDFunc.FORBIDDEN_C5;
                case GDCamp.Type.C6:
                    return GDFunc.FORBIDDEN_C6;
                default:
                    return 0;
            }
        }
    }

    @NoteField(value = "挑战结束时间", detail = "周几结束")
    public static int END_DAY;

    @NoteField(value = "挑战结束时间", detail = "几点几分几秒")
    public static String END_TIME_STR;

    public class Mess {
        @NoteField(value = "初始解锁难度")
        public static final int INIT_DIFFICULTY = 1;
        // TODO: 2022/3/18 配表
        @NoteField(value = "难度最大值")
        public static final int DIFFICULTY_MAX = 15;
        @NoteField(value = "难度最小值")
        public static final int DIFFICULTY_MIN = 1;
        @NoteField(value = "混沌之地副本关卡最高星级")
        public static final int FM_CHAPTER_STAR_MAX = 3;

    }


    public static void initialize(ParamSheet paramSheet) {
        EASY_FIGHT_LEVEL_REQUIRE = GDParamTool.getInt(paramSheet, 70000, 70);
        String endTimeStr = GDParamTool.getString(paramSheet, 999999, "7#23:45:00");
        String[] split = endTimeStr.split("#");
        END_DAY = Integer.parseInt(split[0]);
        END_TIME_STR = split[1];
    }


}
